<?php

class Product_Widgets_Relate_Widget extends Tomato_Widget{
    protected function _prepareShow() {
        $request = $this->_request;
        $productId = $request->getParam('product_id');
        $limit = $request->getParam('limit', 10);
        $productModel = Rabbit_Model_Factory::getInstance()->setModule('product')->getProductModel();
        $relateProducts = $productModel->getRelate($productId, $limit);
        $this->_view->assign('relateProducts', $relateProducts);
    }
}
?>
